//
//  Certificate.m
//  XiangMu
//
//  Created by 康世标 on 15/9/30.
//  Copyright (c) 2015年 康世标. All rights reserved.
//

#import "Certificate.h"

@interface Certificate ()

@end

@implementation Certificate

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    UIImageView * vcImageView = [[UIImageView alloc]init];
    
    
    [vcImageView sd_setImageWithURL:[NSURL URLWithString:_url] placeholderImage:[UIImage imageNamed:@"like"]];

    UIImage * image = vcImageView.image;
    
    UIImageView* imageView =[[UIImageView alloc]init];
    
    imageView.image =image;
  
   imageView.contentMode = UIViewContentModeScaleToFill;

    imageView.frame = self.view.bounds;
    
    [self.view addSubview:imageView];
    
    
    [UIView animateWithDuration:0.3 animations:^{
        imageView.frame=CGRectMake(0,([UIScreen mainScreen].bounds.size.height-image.size.height*[UIScreen mainScreen].bounds.size.width/image.size.width)/2, [UIScreen mainScreen].bounds.size.width, image.size.height*[UIScreen mainScreen].bounds.size.width/image.size.width);
       
    } completion:^(BOOL finished) {
        
        
    }];

    
//    imageView.contentMode = UIViewContentModeScaleAspectFit;
//    self.certificate.
//    
//    self.certificate.image = [UIImage imageNamed:@"gaoqing"];
//   [ self.certificate setImage:[imageView.image stretchableImageWithLeftCapWidth:50 topCapHeight:50]];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
